import instance from "@/utils/index"
import { ICode, IDataType, IData, Token, Sex, User, Data } from '@/types/data'
import { oneItem } from '@/types/data'
import { TypeLogin } from '@/types/typeData'
export const getCodeApi = (data: string) =>
  instance.request<IDataType<ICode>>({
    url: `/captcha?key=${data}`,
    responseType: 'arraybuffer'
    // data
  })

export const loginApi = (data: TypeLogin) =>
  instance.request<IData<Data>>({
    url: '/login',
    method: 'post',
    data
  })

export const asideApi = () =>
  instance.request<IData<oneItem[]>>({
    url: '/menus',
    method: 'get'
  })